<?php
namespace Admin\Controller;

class WechatEstateController extends AdminController
{
    public function __construct() {
        parent::__construct();
    }

    public function lst(){
        $data = D('WxEstate')->search(10);
//        dd($data);
        $this->assign('data',$data['data']);
        $this->assign('page',$data['page']);
        $this->display();
    }

    public function userEstate($wecha_id){
        $where['isverify'] = 1;
        $where['isdelete'] = 0;
        $where['wecha_id'] = $wecha_id;

        $estateData = M('tp_user_estate','','DB_WX')->select();
    }

    public function pass(){
        $res = $data = D('WxEstate')->pass();
        $this->ajaxReturn($res);
    }

    public function notPass(){
        $res = $data = D('WxEstate')->notPass();
        $this->ajaxReturn($res);
    }

    public function delete()
    {
        $id = I('get.id');
        $data['isdelete'] = 1;
        $ok = D('WxEstate')->data($data)->where(['id'=>$id])->save();
        if($ok){
            $res['status'] = 1;
            $res['msg'] = '操作成功';
        }else{
            $res['status'] = false;
            $res['msg'] = '操作失败';
        }
        $this->ajaxReturn($res);
    }
}